package com.itheima.date8;

import java.time.LocalDateTime;
/*
减少或增加
 */
public class Demo06 {

    public static void main(String[] args) {
        LocalDateTime now = LocalDateTime.now();
        LocalDateTime dateTime = now.minusYears(1);
        System.out.println(now);
        System.out.println(dateTime);

        System.out.println(now.minusMonths(5));
        System.out.println(now.minusDays(5));
        System.out.println(now.minusHours(5));
        System.out.println(now.minusMinutes(5));
        System.out.println(now.minusSeconds(5));
        System.out.println(now.minusWeeks(5));
        System.out.println(now.minusYears(5).minusMonths(5));


        System.out.println(now.minusYears(-3));

    }
}
